package com.backstage.common.page;

import java.util.List;

/**
 * @Project authority
 * @Package com.backstage.common.page
 * @Data 2017/7/19下午 3:09.
 * @Aurhor 阮雪峰
 */
public class Page<T> {
    private int page = 1;//当前页
    private int pageSize = 2;
    private int total;
    private boolean flag = true;

    private List<T> rows;

    public int getTotalPage() {
        return (total%pageSize==0?(total/pageSize):(total/pageSize + 1));
    }

    public int getCol() {
        return (page - 1) * pageSize;
    }

    public List<T> getRows() {
        return rows;
    }

    public void setRows(List<T> rows) {
        this.rows = rows;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }
}
